Skip to content

FontRegister: Let BaseRenderBuilder close the resource stream#39

Merged
nihas101 merged 1 commit into
mainfrom
fix/font-loading
Jul 18, 2026
Merged

FontRegister: Let BaseRenderBuilder close the resource stream#39
nihas101 merged 1 commit into
mainfrom
fix/font-loading

Conversation

@nihas101

Copy link
Copy Markdown
Owner

Previously the font register was attempting to handle the lifecycle of the resource stream for the font, which caused it to close it prematurely, causing the renderer to always fall back to the default font. The documentation of BaseRenderBuilder#useFont states

'The InputStream returned by the supplier will be closed by the caller'

so this behavior was pointless anyway. With this commit the FontRegister now just passes along a supplier for opening an input stream to the resource and lets the BaseRenderBuilder handle the rest.

@nihas101 nihas101 self-assigned this Jul 18, 2026
@nihas101 nihas101 added the bug Something isn't working label Jul 18, 2026
Previously the font register was attempting to handle the lifecycle of
the resource stream for the font, which caused it to close it
prematurely, causing the renderer to always fall back to the default
font. The documentation of BaseRenderBuilder#useFont states

	'The InputStream returned by the supplier will be closed by the caller'

so this behavior was pointless anyway. With this commit the FontRegister
now just passes along a supplier for opening an input stream to the
resource and lets the BaseRenderBuilder handle the rest.
@nihas101
nihas101 merged commit 9dd6f72 into main Jul 18, 2026
1 check passed
@nihas101
nihas101 deleted the fix/font-loading branch July 18, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant